<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>
        <%= htmlWebpackPlugin.options.title %>
    </title>



</head>

<body>
    <noscript>
        <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
                Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
</body>
<script>


    /**
      * 找到 当前元素的 远祖 节点 是否有 含有 .status_animation_getme 的元素 并 返回该节点的 animationIsBan 的属性值 [boolean]
      * @param {Element} element  元素
      */
    function getAnimaLocalStatus (element)
    {
        console.count()
        element = GetTargetEl(element, ".status_animation_getme")["value"]
        console.log(element);
        if (element.hasAttribute("animationisban")) {
            console.log(element.getAttribute("animationisban") != false ? true : false);

            return element.getAttribute("animationisban") != false ? true : false
        }
        return true
    }
    window.getAnimaLocalStatus = getAnimaLocalStatus

    /**
     * 获取 当前元素 的 指定 祖先 元素 一直找到 BODY 元素结束
     * @param {Element} node  event.target
     * @param {String} targetStr node id | class
     */
    function GetTargetEl (node, targetStr)
    {
        let search = { searchfor: 'id', done: false, value: undefined };
        let a = ['#', '.'].indexOf(targetStr.slice(0, 1));
        search['searchfor'] = a > -1 ? (a == 0 ? 'id' : 'class') : 'all';

        if (search['searchfor'] == 'all') {
            targetStr = '$' + targetStr;
            search['searchfor'] = 'id';
            searchParentNode(node);
            if (search['done'] == false) {
                search['searchfor'] = 'class';
                searchParentNode(node);
            }
        } else {
            searchParentNode(node);
        }

        function searchParentNode (node)
        {
            if (node.nodeName == 'BODY') {
                return false;
            }
            if (search['searchfor'] == 'id') {
                if (node.id == targetStr.slice(1, undefined)) {
                    search['done'] = true;
                    search['searchfor'] = 'id';
                    search['value'] = node;
                } else {
                    node = node.parentNode;
                    searchParentNode(node);
                }
            }
            if (search['searchfor'] == 'class') {
                if (node.classList.contains(targetStr.slice(1, undefined))) {
                    search['done'] = true;
                    search['searchfor'] = 'class';
                    search['value'] = node;
                } else {
                    node = node.parentNode;
                    searchParentNode(node);
                }
            }
        }
        if (search['done']) {
            node = search['value'];
        }
        return search;
    }
</script>

</html>